package cn.faifai.tagapi.dto;

import cn.faifai.tagapi.entity.IFile;
import cn.faifai.tagapi.entity.Tag;
import lombok.Data;

import java.util.Set;

@Data
public class TagSerialize {
    private Long id;

    private Long parentId;

    private String name;
    private Set<IFile> IFiles;

    public TagSerialize() {
    }

    public TagSerialize(Tag tag) {
        if (tag == null) return;
        this.id = tag.getId();
        this.parentId = tag.getParentId();
        this.name = tag.getName();
        this.IFiles = tag.getIFiles();
    }

    public String toString() {
        return id + ": " +name;
    }
}
